home *** CD-ROM | disk | FTP | other *** search
- Path: news.uh.edu!usenet
- From: Sensarn <txs53132@bayou.uh.edu>
- Newsgroups: comp.lang.c++
- Subject: Is this possible?
- Date: Sat, 23 Mar 1996 11:32:18 -0800
- Organization: AEtna Insurance Agency
- Message-ID: <315451C2.18E9@bayou.uh.edu>
- NNTP-Posting-Host: sip-14262.public-dialups.uh.edu
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.01 (Win16; I)
-
- Is it possible to use NEW for FAR memory allocation in the SMALL
- memory model? I get NULL POINTER ASSIGNMENT when I try this using
- farmalloc() for my FAR allocation:
-
- unsigned char **ptr; /* Pointer to unsigned char pointers */
- ptr=(unsigned char far **)farmalloc(1); /* Create a pointer */
- ptr[0]=(unsigned char far *)farmalloc(64001); /* Allocate memory */
-
- I want to create an array of pointers -- each pointing to 64016 bytes --
- I get NULL POINTER ASSIGNMENT instead. I tried this:
-
- unsigned char far **ptr;
- ptr=new unsigned char far *[1];
- ptr[0]=new unsigned char far[64001];
-
- I got no errors -- except for the fact that I didn't have enough NEAR
- heap for the allocation. Please try to help me,
-
- --
- ______________________________
-
- Steven Sensarn
- E-Mail - txs53132@bayou.uh.edu
- ______________________________
-